﻿using System;
using Ext.Net;
using ModuloSoporte;

namespace IU.Admin
{
    public partial class Admin : System.Web.UI.Page
    {
        protected string Redirect
        {
            get
            {
                return "Default.aspx";
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                string redirect = "";

                try
                {
                    if (string.IsNullOrEmpty(Global.Usuario) ||
                        Global.TipoUsuario != "Servidor")
                    {
                        redirect = Redirect;
                    }

                    // Título menu principal
                    Panel2.Title = "Menú principal - Administrador";
                }
                catch
                {
                    redirect = Redirect;
                }

                if (!string.IsNullOrEmpty(redirect))
                {
                    Response.Redirect(redirect);

                }
            }
        }

        [DirectMethod]
        protected void ButtonLogout_Click(object sender, DirectEventArgs e)
        {
            UIHelper.Logout("Default.aspx");
        }

    }
}
